<?php

defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

class HellochaoController extends JController {

    public function display() {
        $document = JFactory::getDocument();
        //$document->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript' );
        // Set the default view name and format from the Request.
        $vName = JRequest::getCmd('view', 'hellochao'); //sua
        $vFormat = $document->getType();
        $lName = JRequest::getCmd('layout', 'default');
        $app = & JFactory::getApplication();
        $model = $this->getModel('Hellochao');
              
        if ($view = $this->getView($vName, $vFormat)) {
            // Do any specific processing by view.
            switch ($vName) {
                case 'hellochao':
                    break;
                    // If the user is already logged in, redirect to the profile page.
                default:
                    $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
                    return;
            }

            // Push the model into the view (as default).

            $view->setModel($model, true);
            $view->setLayout($lName);

            // Push document object into the view.
            $view->assignRef('document', $document);
            $view->display();
        }
    }

}
?>